/* 图表的option*/
bt1option = {
    color: tbcolor,
    //2.1图标标题
    title: {
        text: '进货出货比例与数据',
        left: 'center',
        top: "10px",
        textStyle: {
            "color": "#00E8F2",
            'fontFamily': '宋体'
        }
    },
    backgroundColor: "#000000",
    tooltip: {
        trigger: 'item'
    },
    //2.2鼠标悬浮时的内容
    tooltip: {
        trigger: "item",
        formatter: "{a}:<br/><br/>{b}:{c}({d}%)"
    },
    //2.3图例
    legend: {
        orient: 'vertical',
        left: '25px',
        top: "50px",
        textStyle: {
            "color": tbcolor,
            'fontFamily': '宋体'
        }
    },
    //2.4图标的形状、图表的数据、图表的样式
    series: [{
        name: "正副班数比例",
        type: "pie",
        radius: "50%",
        data: [{
            name: "进货",
            value: "4621"
        }, {
            name: "出货",
            value: "3758"
        }],
        emphasis: {
            itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
            }
        }
    }]
};

/*饼图2 option*/
bt2option = {
    color: [
        "#dd6b66",
        "#759aa0",
        "#e69d87",
        "#8dc1a9",
        "#ea7e53",
        "#eedd78",
        "#73a373",
        "#73b9bc",
        "#7289ab",
        "#91ca8c",
        "#f49f42"
    ],
    title: {
        text: '仓库货物类型占比',
        left: 'center',
        top: '10px',
        textStyle: {
            "color": "#00E8F2",
            'fontFamily': '宋体',
            'fontSize': 20
        }
    },
    backgroundColor: "#000000",
    tooltip: {
        trigger: 'item'
    },
    legend: {
        orient: 'horizontal',
        left: 'left',
        textStyle: {
            "color": tbcolor,
            'fontFamily': '宋体'
        },
        top: "50px"
    },
    series: [{
        name: '仓库货物类型占比',
        type: 'pie',
        radius: '50%',
        data: [{
            value: 250,
            name: '玩具'
        },
        {
            value: 980,
            name: '食品'
        },
        {
            value: 380,
            name: '生活用品'
        },
        {
            value: 200,
            name: '电器'
        },
        {
            value: 684,
            name: '家具'
        },
        {
            value: 300,
            name: '文具'
        }
        ],
        emphasis: {
            itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
            }
        }
    }]
};


bt3option = {
    color: tbcolor,
    tooltip: {
        trigger: 'axis',
        showContent: false
    },

    title: {
        text: "7天内进货量与出货量情况",
        left: "center",
        top: '10px',
        textStyle: {
            "color": "#00f5ff",//标题颜色蓝湖
            'fontFamily': '宋体'
        }
    },
    dataset: {
        source: [
            ['时间', '20220525', '20220526', '20220527', '20220528', '20220529', '20220530', '20220531'],
            ['进货量', 214, 356, 124, 564, 781, 461, 354],
            ['出货量', 154, 246, 364, 451, 648, 550, 667]
        ]
    },
    xAxis: {
        type: 'category',
        axisLine: {
            lineStyle: {
                color: "#cccccc",
                width: 1, //这里是为了突出显示加上的  
            }
        },
    },
    yAxis: {
        gridIndex: 0,

        axisLine: {
            lineStyle: {
                color: "#cccccc",
                width: 1, //这里是为了突出显示加上的  
            }
        },
    },
    tooltip: {
        trigger: 'axis'  //鼠标悬浮显示信息
    },
    legend: {
        orient: 'vertical',
        left: 'left',
        top: "50px",
        textStyle: {
            color: tbcolor,
            'fontFamily': '宋体'
        },

    },

    grid: { top: '30%' },
    series: [
        {
            type: 'line',
            symbol: "none",
            smooth: true,
            seriesLayoutBy: 'row',
            emphasis: { focus: 'series' }
        },
        {
            type: 'line',
            smooth: true,
            symbol: "none",
            seriesLayoutBy: 'row',
            emphasis: { focus: 'series' },
        },

    ]
};



const data = [["08时", 0.9], ["09时", 1.1], ["10时", 1.7], ["11时", 1.5], ["12时", 1], ["13时", 1.1], ["14时", 2.4], ["15时", 2.6], ["16时", 1.7], ["17时", 2.1], ["18时", 1.5], ["19时", 0.9], ["20时", 0.5]];
const dateList = data.map(function (item) {
    return item[0];
});
const valueList = data.map(function (item) {
    return item[1];
});

bt4option = {
    color: tbcolor,
    visualMap: [
        {
            show: false,
            type: 'continuous',
            seriesIndex: 0,
            min: 0,
            max: 400
        }],
    backgroundColor: "black",
    title: {
        text: "销售额:按时间段分",
        left: "center",
        textStyle: {
            color: "#00E8F2",
            fontFamily: "宋体",
            fontSize: 20
        }
    },
    xAxis: {
        type: 'category',
        data: dateList,
        axisLine: {
            lineStyle: {
                color: "#cccccc",
            }
        }

    },
    yAxis: {
        name: '万元',
        type: 'value',
        axisLine: {
            lineStyle: {
                color: "#cccccc"
            }
        },



    },
    tooltip: {
        trigger: "item",
        formatter: "时间 : {b}<br/><br/>载客次数 : {c}"
    },
    series: [{
        data: valueList,
        type: 'line',
        symbol: 'null',
        symbolSize: 0,
        lineStyle: {

            normal: {

                width: "3"
            }
        },
        itemStyle: {
            normal: {
                borderWidth: "4"
            }
        },
        smooth: true,
    }]
};

bt5option = {
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'cross',
            crossStyle: {
                color: '#999'
            }
        }
    },
    title: {
        text: "近一周销售额",
        left: "center",
        textStyle: {
            color: "#00E8F2",
            fontFamily: "宋体",
            fontSize: 20
        }
    },
    toolbox: {
        feature: {
            dataView: { show: true, readOnly: false },
            magicType: { show: true, type: ['line', 'bar'] },
            restore: { show: true },
            saveAsImage: { show: true }
        }
    },
    xAxis: [
        {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
            axisPointer: {
                type: 'shadow'
            },
            axisLine: {
                lineStyle: {
                    color: "#cccccc"
                }
            },
        }
    ],
    yAxis: [
        {
            type: 'value',
            name: '万元',
            min: 0,
            max: 250,
            interval: 50,
            axisLine: {
                lineStyle: {
                    color: "#cccccc"
                }
            },
        },
        {
            type: 'value',
            name: '万元',
            min: 0,
            max: 25,
            interval: 5,
            axisLine: {
                lineStyle: {
                    color: "#cccccc"
                }
            },

        }
    ],
    series: [

        {
            name: '销售额',
            type: 'bar',
            tooltip: {
                valueFormatter: function (value) {
                    return value + ' ml';
                }
            },
            data: [
                23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
            ]
        },
        {
            name: '毛收入',
            type: 'bar',
            tooltip: {
                valueFormatter: function (value) {
                    return value;
                }
            },
            data: [
                12.1, 14.5, 55.2, 78.4, 94.9, 17.5, 13.1
            ]
        },
        {
            name: '比率',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
                valueFormatter: function (value) {
                    return value + '万元';
                }
            },
            data: [4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5]
        }
    ]
};

bt6option = {
    color: tbcolor,
    title: {
        text: "每日出口销售类型占比",
        left: "center",
        textStyle: {
            color: "#00E8F2",
            fontFamily: "宋体",
            fontSize: 20
        }
    },
    tooltip: {
        trigger: 'item'
    },
    legend: {
        orient: 'horizontal',
        left: '15px',
        top: "25px",
        textStyle: {
            "color": tbcolor,
            'fontFamily': '宋体'
        }
    },
    series: [
        {
            type: 'pie',
            radius: ['40%', '80%'],
            avoidLabelOverlap: false,
            itemStyle: {
                borderRadius: 10,
                borderColor: '#fff',
                borderWidth: 2
            },
            label: {
                show: false,
                position: 'center'
            },
            emphasis: {
                label: {
                    show: true,
                    fontSize: '20',
                    fontWeight: 'bold'
                }
            },
            labelLine: {
                show: false
            },
            data: [
                { value: 1048, name: '生活用品' },
                { value: 735, name: '食品' },
                { value: 580, name: '家具' },
                { value: 484, name: '电器' },
                { value: 300, name: '文具' },
                { value: 340, name: '玩具' }
            ]
        }
    ]
};

bt7option = {
    color: tbcolor,
    legend: {},
    tooltip: {},
    title: {
        text: '近一周进货出货利润对比',
        left: 'center',
        textStyle: {
            "color": "#00E8F2",
            'fontFamily': '宋体'
        }
    },
    dataset: {
        source: [
            ['date', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
            ['进货', 11.1, 11.1, 21.5, 57.2, 67.3, 18.1, 6.9],
            ['出货', 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0],
            ['利润', 12.1, 14.5, 55.2, 78.4, 94.9, 17.5, 13.1],
        ]
    },
    xAxis: {
        type: 'category',
        axisLine: {
            lineStyle: {
                color: "#cccccc"
            }
        },
    },
    yAxis: {
        axisLine: {
            lineStyle: {
                color: "#cccccc"
            }
        },
    },
    legend: {
        orient: 'horizontal',
        left: 'center',
        top: "25px",
        textStyle: {
            "color": tbcolor,
            'fontFamily': '宋体'
        }
    },

    series: [{ type: 'bar' }, { type: 'bar' }, { type: 'bar' }, { type: 'bar' }, { type: 'bar' }, { type: 'bar' }, { type: 'bar' }]
};

bt8option = {
    color: tbcolor,
    title: {
        text: '当日人流量',
        left: 'center',
        top: "20px",
        textStyle: {
            "color": "#00E8F2",
            'fontFamily': '宋体'
        }
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    legend: {
        orient: 'horizontal',
        left: '25px',
        top: "25px",
        textStyle: {
            "color": tbcolor,
            'fontFamily': '宋体'
        }
    },
    grid: {
        left: '5%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: {
        type: 'value',
        axisLine: {
            lineStyle: {
                color: "#cccccc"
            }
        },
    },
    yAxis: {
        name: '时间',
        type: 'category',
        data: ['08:00', '10:00', '12:00', '14:00', '16:00', '18:00', '20:00'],
        axisLine: {
            lineStyle: {
                color: "#cccccc"
            }
        },
    },
    series: [
        {
            name: '人/次    ',
            type: 'bar',
            data: [254, 554, 386, 441, 471, 354, 187]
        }
    ]
};


bt9option = {
    title: {
        text: '近15天利润散点图走势',
        left: 'center',
        top: "20px",
        textStyle: {
            "color": "#00E8F2",
            'fontFamily': '宋体'
        }
    },
    xAxis: {
        axisLine: {
            lineStyle: {
                color: "#cccccc"
            }
        },
    },
    yAxis: {
        name: '万元',
        axisLine: {
            lineStyle: {
                color: "#cccccc",
            }
        },
    },
    series: [
        {
            symbolSize: 10,
            data: [
                [1, 2.4],
                [2, 3.5],
                [3, 3.8],
                [4, 4.1],
                [5, 4.3],
                [6, 4.7],
                [7, 5.5],
                [8, 6.1],
                [9, 6.8],
                [10, 7.6],
                [11, 7.4],
                [12, 6.5],
                [13, 7.8],
                [14, 7.9],
                [15, 8.1],
            ],
            type: 'scatter'
        }
    ]
};